import service from '@/utils/request'
// import service from '@/utils/env'

export const getMonitorUrl = (id: any) => {
    return service.get(`/equipment/equipment/get/video?id=${id}`)
}


export const getEquipmentIds = (regionCode: any) => {
    return service.get(`/equipment/equipment/get/ids?regionCode=${regionCode}`)
}


export const getEqByCode = (regionCode: any) => {
    return service.get(`/equipment/screen/getEquipmentByRegionCode/${regionCode}`)
}

export const getEqControlItem = (id: any) => {
    return service.get(`/equipment/control/items?equipmentId=${id}`)
}

// 执行网关控制
export const executeGatewayControl = (id: any, data: any) => {
    return service.post(`/equipment/control/${id}/execute`, data)
}

// it资产搜索
export const assetType = () => {
    return service.get(`/system/asset/type`)
}

// 部门

export const workspace = () => {
    return service.post(`/system/department/list`)
}

export const getTypeList = () => {
    return service.get('/equipment/equipment/template/type/list')
}

// 获取网络设备的设备信息
export const getEqDetails = (eid: any) => {
    return service.post(`/equipment/equipment/get/equipment/detail?equipmentId=${eid}`)
}

// 广播 
export const setBroadCast = (data: any) => {
    return service.post('/equipment/control/broadcast', data);
}

export const getEqStatus = (params) => {
    return service.get(`/equipment/screen/equipmentByRegionCodes?codes=${params}`)
}
/**获取点位配置下拉菜单设备列表 */
export const getSubordinateEquipments = (params) => {
    return service.post(`/equipment/screen/getSubordinateEquipments`, params)
}

/**获取全部点位 */
export const getEqPoint = (code = 'ALL') => {
    return service.get(`/equipment/screen/getEquipmentPoints?code=${code}`)
}

/**保存点位配置 */
export const savePoint = (arr) => {
    return service.post(`/equipment/screen/addEquipmentPoints`, { code: 'ALL', points: arr })
}

/**获取设备类型列表 */
export const getEqType = () => {
    return service.get('/equipment/equipment/template/type/list')
}
